//
//  UIView+MyCircleView.m
//  com.Ofans
//
//  Created by wang on 15-4-27.
//  Copyright (c) 2015年 wang. All rights reserved.
//

#import "UIView+MyCircleView.h"

@implementation UIView (MyCircleView)
- (void) clipToCircleView
{
    self.layer.cornerRadius=self.bounds.size.height/2;
    self.layer.masksToBounds=YES;
    self.clipsToBounds=YES;
}
- (void) clipToCircleViewWithcornerRadius:(float)radius;
{
    self.layer.cornerRadius=radius;
    self.layer.masksToBounds=YES;
    self.clipsToBounds=YES;
}

- (void) clipToCircleViewWithBoderLine:(float)lineWidth andLineColor:(UIColor *)color
{
    self.layer.cornerRadius=self.bounds.size.height/2;
    self.layer.masksToBounds=YES;
    self.clipsToBounds=YES;
    self.layer.borderWidth=lineWidth;
    self.layer.borderColor=[color CGColor];
}
- (void) clipToCircleViewWithBoderLine:(float)lineWidth andLineColor:(UIColor *)color andCornerRadius:(float)corner
{
    self.layer.cornerRadius=corner;
    self.layer.masksToBounds=YES;
    self.clipsToBounds=YES;
    if (color) {
        self.layer.borderWidth=lineWidth;
        self.layer.borderColor=[color CGColor];
    }
}

- (void)setBorderColorWithUIColor:(UIColor *) color
{
    self.layer.borderColor = color.CGColor;
}
@end
